package com.daka.controller;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Created by yangx
 * CreateTime: 2016/12/13 20:11
 */
public class Test {

    public static void main(String[] args) {

        String str = "as{0}asddsad{100}adssadasdsada{9}asdasdsada{19}aaaaa";
        String regex = "^.*\\{\\d+\\}.*$";

        System.out.println(str.matches(regex));


        String regex1 = "(^[a-z0-9A-Z])[a-z0-9A-Z_]{1,5}([a-z0-9-A-Z])";
        boolean flg = Pattern.matches(regex1, "123456");
        System.out.println(flg);
    }


}



